//私有属性和私有方法只可以在文件文件内部调用
class Wallet {
  //私有属性
  double _balance = 0;
  //查看用户
  void _getUserInfo() {
    print("用户名:");
    print("年龄: ");
    print("性别: ");
  }

  //查看余额
  void getInfo() {
    print("余额: $_balance");
  }

  //存钱
  void addBalance(double amount) {
    _balance += amount;
  }

  //取钱
  void subtractBalance(double amount) {
    _balance -= amount;
  }

  //获取余额
  double getBalance() {
    return _balance;
  }
}
